home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1996 July: Mac OS SDK / Dev.CD Jul 96 SDK / Dev.CD Jul 96 SDK1.toast / Development Kits (Disc 1) / OpenDoc Development Framework / ODFDev / Container / Sources / Part.h < prev    next >
Encoding:
Text File  |  1996-04-25  |  4.1 KB  |  138 lines  |  [TEXT/MPS ]

  1. //========================================================================================
  2. //
  3. //    File:                Part.h
  4. //    Release Version:    $ ODF 1 $
  5. //
  6. //    Copyright:    (c) 1993 - 1996 by Apple Computer, Inc., all rights reserved.
  7. //
  8. //========================================================================================
  9.  
  10. #ifndef PART_H
  11. #define PART_H
  12.  
  13. // ----- Part Layer -----
  14.  
  15. #ifndef FWPARTNG_H
  16. #include "FWPartng.h"
  17. #endif
  18.  
  19. #ifndef FWSELECT_H
  20. #include "FWSelect.h"
  21. #endif
  22.  
  23. //========================================================================================
  24. //    Forward Declarations
  25. //========================================================================================
  26.  
  27. class FW_CContent;
  28. class FW_CGraphicContext;
  29. class FW_CMenuBar;
  30. class FW_CMenuEvent;
  31. class FW_CMouseEvent;
  32. class FW_CPresentation;
  33.  
  34. class CProxy;
  35. class CPartContent;
  36. class CContainerSelection;
  37.  
  38. //========================================================================================
  39. //    class CContainerPart
  40. //========================================================================================
  41.  
  42. class CContainerPart : public FW_CEmbeddingPart
  43. {
  44.   public:
  45.     FW_DECLARE_CLASS
  46.     FW_DECLARE_AUTO(CContainerPart)
  47.     
  48. //----------------------------------------------------------------------------------------
  49. //    Initialization/Destruction
  50. //
  51.   public:        
  52.     CContainerPart(ODPart* odPart);
  53.     virtual ~ CContainerPart();
  54.  
  55.     virtual void            Initialize(Environment* ev);
  56.     
  57. //----------------------------------------------------------------------------------------
  58. //    Inherited API
  59. //
  60.   public:
  61.     virtual FW_Boolean        DoMenu(Environment* ev, 
  62.                                     const FW_CMenuEvent& theMenuEvent);
  63.     virtual FW_Boolean        DoAdjustMenus(Environment* ev, 
  64.                                     FW_CMenuBar* menuBar, 
  65.                                     FW_Boolean hasMenuFocus, 
  66.                                     FW_Boolean isRoot);
  67.     
  68.     virtual FW_CFrame*         NewFrame(Environment* ev,
  69.                                     ODFrame* odFrame, 
  70.                                     FW_CPresentation* presentation,
  71.                                     FW_Boolean fromStorage);
  72.                                     
  73.     virtual FW_CContent*    NewPartContent(Environment* ev);
  74.  
  75.     virtual void            EmbeddedFrameRemoved(Environment *ev, FW_MProxy* proxy);
  76.  
  77. //----------------------------------------------------------------------------------------
  78. //    New API
  79. //
  80.   public:    
  81.     void                AddProxyToPart(Environment* ev, CProxy* proxy);
  82.  
  83.     void                DetachProxy(Environment* ev, CProxy* proxy);
  84.     void                AttachProxy(Environment* ev, CProxy* proxy);
  85.  
  86.     void                DeleteProxy(Environment* ev, CProxy* proxy);
  87.     
  88.     CProxy*             WhichProxy(Environment* ev, 
  89.                                     FW_CGraphicContext& gc,
  90.                                     const FW_CPoint& where,
  91.                                     FW_Boolean hasToBeSelected) const;
  92.  
  93.     FW_CPoint            GetDrawingSize() const;
  94.     FW_CPresentation*    GetMainPresentation() const;
  95.     CPartContent*        GetPartContent() const;
  96.  
  97. //----------------------------------------------------------------------------------------
  98. //    Data Members
  99. //
  100.   private:    
  101.     CPartContent*        fPartContent;
  102.  
  103.     CContainerSelection* fContainerSelection;    // Attention I don't own the selection the presentation is
  104.     FW_CPresentation*    fMainPresentation;
  105.  
  106.     FW_CPoint            fDrawingSize;
  107. };
  108.  
  109. //========================================================================================
  110. //    Inlines
  111. //========================================================================================
  112.  
  113. //----------------------------------------------------------------------------------------
  114. //    CContainerPart::GetPartContent
  115. //----------------------------------------------------------------------------------------
  116. inline CPartContent* CContainerPart::GetPartContent() const
  117. {
  118.     return fPartContent;
  119. }
  120.  
  121. //----------------------------------------------------------------------------------------
  122. //    CContainerPart::GetDrawingSize
  123. //----------------------------------------------------------------------------------------
  124. inline FW_CPoint CContainerPart::GetDrawingSize() const
  125. {
  126.     return fDrawingSize;
  127. }
  128.  
  129. //----------------------------------------------------------------------------------------
  130. //    CContainerPart::GetMainPresentation
  131. //----------------------------------------------------------------------------------------
  132. inline FW_CPresentation* CContainerPart::GetMainPresentation() const
  133. {
  134.     return fMainPresentation;
  135. }
  136.  
  137. #endif
  138.